package models

import (
	"github.com/goravel/framework/database/orm"
)

type PrylockLog struct {
	orm.Model
	ActionTime      string         `gorm:"column:action_time;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);comment:'操作时间'" form:"action_time" json:"action_time"`
	PlayerName      string         `gorm:"column:player_name;type:varchar(255);not null;default:'';comment:'玩家名'" form:"player_name" json:"player_name"`
	StreamId        string         `gorm:"column:stream_id;type:varchar(255);not null;default:'';comment:'流id'" form:"stream_id" json:"stream_id"`
	LockResult      string         `gorm:"column:lock_result;type:varchar(255);not null;default:'';comment:'撬锁结果'" form:"lock_result" json:"lock_result"`
	LockTimes       int            `gorm:"column:lock_times;type:int(11);not null;default:0;comment:'撬锁次数'" form:"lock_times" json:"lock_times"`
	ElapsedTime     float64        `gorm:"column:elapsed_time;type:float;not null;default:0;comment:'耗时'" form:"elapsed_time" json:"elapsed_time"`
	OwnerName       string         `gorm:"column:owner_name;type:varchar(255);not null;default:'';comment:'锁主名'" form:"owner_name" json:"owner_name"`
	OwnerSteamid    string         `gorm:"column:owner_steamid;type:varchar(255);not null;default:'';comment:'锁主steamid'" form:"owner_steamid" json:"owner_steamid"`
	LockLevel       string         `gorm:"column:lock_level;type:int(11);not null;default:0;comment:'锁级别'" form:"lock_level" json:"lock_level"`
	TargetItem      string         `gorm:"column:target_item;type:varchar(255);not null;default:'';comment:'目标物品'" form:"target_item" json:"target_item"`
	UnlockPosition  string         `gorm:"column:unlock_position;type:varchar(255);not null;default:'';comment:'解锁位置'" form:"unlock_position" json:"unlock_position"`
	LockArea        string         `gorm:"column:lock_area;type:varchar(255);not null;default:'';comment:'锁区域'" form:"lock_area" json:"lock_area"`
	OriginalText    string         `gorm:"column:original_text;type:text;not null;comment:'原文'" json:"original_text"`
	ConfigurationID int            `gorm:"column:configuration_id;type:int;null" form:"configuration_id" json:"configuration_id"`
	Configuration   *Configuration `gorm:"foreignkey:ConfigurationID" form:"-" json:"-"`
}

func (*PrylockLog) TableName() string {
	return "prylocklogs"
}
